{% extends 'ProjResManBundle::layout.html.twig' %}

{% block header_menu_login_href %}{% if template_content.auth.isAuth == false %}{{ template_content.header.menu.login }}{% else %}{{ template_content.header.menu.logout }}{% endif %}{% endblock %}
{% block header_menu_login_text %}{% if template_content.auth.isAuth == false %}{{ template_content.header.text.login }}{% else %}{{ template_content.header.text.logout }}{% endif %}{% endblock %}
{% block header_menu_login_user %}{% if template_content.auth.isAuth == true %}{{ template_content.auth.user }}{% endif %}{% endblock %}
{% block header_menu_login_message %}{% if template_content.auth.isAuth == true %}User:{% endif %}{% endblock %}
{% block content %}

<div id="page_content">
    <div id="submenu">
        <div id="submenu_float1">
            <div id="submenu_float2">
                <ul>
                    {% block submenu -%}
                    {% for item in template_content.content.submenu %}
                    <ul class="submenu_option">
                        <a href={{ item.href }}>
                        <li class="submenu_header">{{ item.title }}</li>
                        <li class="submenu_details">{{ item.title_desc }}</li>
                    </a>
                    </ul>
                    {% endfor %}
                    {% endblock %}
                </ul>
            </div>
        </div>
    </div>
    <div id="container">
        <div>
            <h3>Alte resurse asignate task-ului</h3>
            
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th>Nume</th>
                        <th>Tip</th>
                        <th>Cantitate</th>
                    </tr>
                </thead>
                <tbody>
                    {% for taskResource in taskResources %}
                        <tr>
                            <td>{{ taskResource.resources.name }}</td>
                            <td>{{ taskResource.resources.type }}</td>
                            <td>{{ taskResource.amount }}</td>
                            <td>
                                <a href="{{ path("headmaster_details_other_remove", {"task_id": taskId, "taskresource_id": taskResource.id}) }}">
                                    <button class="btn btn-info">Elimina</button>
                                </a>
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
            
        <div>
            <h3>Alte resurse</h3>
            
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th>Nume</th>
                        <th>Tip</th>
                        <th>Cantitate</th>
                        <th>Cantitate de adaugat</th>
                    </tr>
                </thead>
                <tbody>
                    {% for resource in allResources %}
                        <tr>
                            <td>{{ resource.name }}</td>
                            <td>{{ resource.type }}</td>
                            <td>{{ resource.amount }}</td>
                            <form action="{{ path("headmaster_details_other_add") }}" method="get">
                                <td>
                                    {% if resource.amount != null %}
                                        <input name="amount" class="input-small">
                                    {% endif %}
                                    <input name="task_id" value="{{ taskId }}" style="display: none">
                                    <input name="resource_id" value="{{ resource.id }}" style="display: none">
                                </td>
                                <td>
                                    <input type="submit" value="Adauga" class="btn btn-info">
                                </td>
                            </form>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
             
        <div style="padding-bottom: 50px">
            <a href="{{ path("headmaster_tasks_details", {"activity_id": activityId, "task_id": taskId}) }}" style="float: left; padding-right: 20px; text-decoration: none">
                <button class="btn btn-info">Inapoi</button>
            </a>
        </div>
    </div>
</div>

{% endblock %}